﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EazyCMS.Common;

namespace EazyCMS.Web.Plugin.Vote.admin
{
    public partial class vote_show : EazyCMS.Web.UI.ManagePage
    {
        private int id = 0;
        protected Model.vote model = new Model.vote();

        protected void Page_Load(object sender, EventArgs e)
        {
            this.id = EazyRequest.GetQueryInt("id");
            if (this.id == 0)
            {
                JscriptMsg("传输参数不正确！", "back");
                return;
            }
            if (!new BLL.vote().Exists(this.id))
            {
                JscriptMsg("信息不存在或已被删除！", "back");
                return;
            }
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("plugin_vote", EazyEnums.ActionEnum.View.ToString()); //检查权限
                ShowInfo(this.id);
            }
        }

        #region 赋值操作=================================
        private void ShowInfo(int _id)
        {
            BLL.vote bll = new BLL.vote();
            model = bll.GetModel(_id);
            //绑定投票选项
            rptList.DataSource = model.options;
            rptList.DataBind();
        }
        #endregion
    }
}